 	<% if (User.find(session[:user_id])).canAddResourcesToFavourites then %>
 		<% if (not Favorite.isAFavorite((session[:user_id]),@resource.id)) then %>
 			<%= link_to_remote image_tag("fav-add-1.png", 
				:title=>"add to favourites"), 
			:url=>{
				:action => "addFavoriteResource", 
				:controller => "resources", 
				:user_id => session[:user_id] , 
				:id => @resource.id},
				:update=>"add_remove_fav_"+@resource.id.to_s,
				:success=>visual_effect(:pulsate, "add_remove_fav_#{@resource.id.to_s}") %> 
	 	<% else %>
	    	<%= link_to_remote image_tag("fav-del.png" , 
				:title=>"remove from favourites" ), 
			:url=>{
				:action => "deleteFavoriteResource" , 
				:controller => "resources", 
				:user_id => session[:user_id] , 
				:id => @resource.id},
				:update=>"add_remove_fav_"+@resource.id.to_s,
				:success=>visual_effect(:pulsate, "add_remove_fav_#{@resource.id.to_s}") %>
	 	<% end %>
	 <% end %>
